﻿using System;

using System.Collections.Generic;
using System.Text;

namespace Silvermoon.Animations
{
    public class BackEase : EasingFunctionBase
    {

        public static readonly BackEase In = new BackEase { Mode = EasingMode.EaseIn };
        public static  readonly  BackEase Out = new BackEase{ Mode=EasingMode.EaseOut};

        public Double Amplitude { get; set; }

        public BackEase()
            : base()
        {
            Amplitude = 0.5f;
        }

        protected override float EaseValue(float normalizedTime)
        {
            double t = normalizedTime;
            return ((float)(Math.Pow(t, 3d) - t * Amplitude * Math.Sin(t * Math.PI)));
        }
    }
}
